package com.softserveinc.interactive_board.domain;


import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name="users")
public class User {
	
	public User(Long id, String login, String password, UserType userType) {
		super();
		this.id = id;
		this.login = login;
		this.password = password;
		this.userType = userType;
	}
	
	public User(Long id) {
		super();
		this.id = id;
	}
	
	public User() {
		this(new Long(0), "login", "password", new UserType());
	}

	@Id
	@Column(name = "user_id")
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	
	@Column(name = "login", length = 25)
	private String login;
	
	@Column(name = "password", length = 25)
	private String password;
	
	@ManyToOne
	@JoinColumn(name = "user_type")
	private UserType userType;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public UserType getUserType() {
		return userType;
	}

	public void setUserType(UserType userType) {
		this.userType = userType;
	}
	
}